package day05.pm;

/**
 * switch...case
 * 键盘上下左右键
 */
public class Demo02 {
    public static void main(String[] args) {
        int key = 38;
        switch(key){
            case 37:
                System.out.println("up");
                break;
            case 38:
                System.out.println("right");
                break;
            case 39:
                System.out.println("down");
                break;
            case 40:
                System.out.println("left");
                break;
            default:
                System.out.println("输入错误");
        }
    }
}
